package com.mlk.bet.API;

import com.mlk.bet.service.BetService;
import com.mlk.core.util.ServerResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/eng/bet")
public class EngBetAPI {


    @Resource
    private BetService betService;

    /**
     * 获取一次守将需要的积分数
     * @return
     */
    @GetMapping("getBetScore")
    public ServerResponse getBetScore(){
        return this.betService.getBetScore();
    }

    /**
     * 获取抽奖的内容
     * @return
     */
    @GetMapping("getBetContent")
    public ServerResponse getBetContent(){
        return this.betService.getBetContent();
    }


    /**
     * 获取用户是否能进行抽奖
     * @param openId
     * @return
     */
    @GetMapping("checkOwnScore")
    public ServerResponse checkOwnScore(String openId){
        return this.betService.checkOwnScore(openId);
    }

    /**
     * 积分抽奖
     * @return
     */
    @PostMapping("bet")
    public ServerResponse bet(String openId){
        return this.betService.bet(openId);
    }

}
